<?php $this->headScript()->captureStart()?>
var sel_id='';
$(document).ready(function(){
	$("#m-list tbody tr:even").css('background','#fff');
	$("#m-list tbody tr:odd").css('background','#ffe');
	$("#m-list .man").click(function(){
		sel_id = $(this).attr('id').substr(4);
		$("#tabs").show();
		$("#setform").show();
		modset(sel_id);	// 設定模組
		//aclset(sel_id); // 權限列表
		$(".setitem").removeClass('setitem');

		$(this).addClass('setitem');
	})

<?php if ($this->infoMenssage):?>
	$("#message").html('<?php echo $this->infoMenssage?>').fadeOut('show');
<?php endif;?>
});
<?php $this->headScript()->captureEnd()?>
<div id="message"></div>
<div id="kind-nav">
	<a href='<?php echo $this->route('list')?>' ><?php echo $this->translate('topPage')?></a>
	<?php foreach ($this->moduleNavMenu as $id=>$val):?>
	/ <a href='<?php echo $this->route('list')?>/id/<?php echo $id?>' nav_id='<?php echo $this->escape($id)?>'><?php echo $this->escape($val)?></a>
	<?php endforeach?>

</div>

<form name="myform" id="myform" action="<?php echo $this->route('modulesave') ?>" method="post">
	<table id="m-list" >
	<thead>
	<tr>
		<th><?php echo $this->translate('module_order')?></th>
		<th><?php echo $this->translate('module_open')?></th>
		<th><?php echo $this->translate('module_name')?></th>
		<th><?php echo $this->translate('module_manager')?></th>
	</tr>
	</thead>
	<tbody>
	<?php foreach($this->resources as $data):?>
	<tr id="<?php echo $data['id']?>" <?php if($data['published']< 1):?>class="unActived "<?php endif?>>
		<td align="center"><input name="sort[<?php echo $data['resource_id']?>]" type="text" size="2" value="<?php echo $data['sort'] ?>"></td>
		<td align="center">
		<?php if ($data['published']==9 or @$this->resChild[$data['resource_id']]):?>
		<input type="checkbox" value=1 checked="true" disabled="true">
		<input name="published[<?php echo $data['resource_id']?>]" type="hidden" value="1">
		<?php else:?>
		<input name="published[<?php echo $data['resource_id']?>]" type="checkbox" value="1" <?php if($data['published']):?>checked="true"<?php endif?>	>
		<?php endif?>
		</td>
		<td  id="title-<?php echo $data['id']?>">
		<?php if (@$this->resChild[$data['resource_id']]):?>
		<a href='<?php echo $this->route('list')?>/id/<?php echo $data['resource_id']?>' ><?php echo $this->escape($data['title'])?></a>
		<?php else:?>
		<?php echo $data['title']?>
		<?php if ($data['kind']=='module'):?>(<?php echo $data['resource_id']?>)<?php endif?>
		<?php endif;?>
		</td>
		<td align="center" class="man" id="mod-<?php echo $data['id']?>"><?php echo $this->translate('manager')?></td>
	</tr>
	<?php endforeach; ?>

	<tr><td colspan="5">
	<input type="hidden" id="hidden_id" name="id" value="<?php echo $this->hidden_id?>">
	<input type="submit" name="act"  value="<?php echo $this->translate('setup')?>" />
	</td></tr>
	</tbody>
	</table>
	</form>